cc.Class({
    extends: cc.Component,
    properties: {
        pickRadius:0,
    },
    getPlayerDistance:function(){
        var playerPos=this.game.player.getPosition();
        var dist=this.node.position.sub(playerPos).mag();
        return dist;
    },
    onPicked:function(){
        this.game.num++;
        this.game.score.string=this.game.num+"分";
        this.game.spawnNewStar();
        this.node.destroy();
    },
    start () {

    },
    update (dt) {
        if(this.getPlayerDistance()<this.pickRadius){
            this.onPicked();
            return;
        }
    },
});
